package com.jxd.project.wzgl.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.jxd.project.menu.model.ApplicationGoods;
import com.jxd.project.wzgl.vo.HistoryBRGoods;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface IApplicationGoodsDao extends BaseMapper<ApplicationGoods> {
    /**
     * 根据申请ID删除申请物资子表数据
     * @param applicationId
     * @return
     */
    boolean deleteByApplicationId(int applicationId);

    /**
     * 根据多个申请ID删除申请物资子表数据
     * @param applicationIds
     * @return
     */
    boolean deleteByApplicationIds(List<Integer> applicationIds);

    /**
     * 根据员工Id查询未归还的记录
     * @param employeeId
     * @param warehouseId
     * @return
     */
    List<ApplicationGoods> selectNotReturnWithEmployeeId(@Param("empno") int employeeId,@Param("warehouseId") int warehouseId);

    /**
     * 根据申请ID查询申请物资子表数据
     * @param applicationId
     * @return
     */
    List<ApplicationGoods> selectWithApplicationId(int applicationId);

    /**
     * 批量更新冲销状态
     * @param applicationIds
     * @return
     */
    boolean updateGoodsIsReturn(List<Integer> applicationIds);

    /**
     * 批量更新归还申请表信息
     * @param brIds
     * @return
     */
    boolean updateApplicationStatus(List<Integer> brIds);

    /**
     * 查询历史申请物资
     * @param empNo
     * @return
     */
    List<HistoryBRGoods> selectHistoryWithEmpNo(Integer empNo);
}
